/**
 * @description 用户档案配置信息
 * @author caorui
 * @Data 2022-09-30 09:36
 *
 */
//用户档案表头
const userTableColumn = [
  {
    label: "所属公司",
    prop: "companyCount",
    tooltip: true,
    width: "80",
  },
  {
    label: "客户编码",
    prop: "cusCode",
    tooltip: true,
  },
  {
    label: "客户名称",
    prop: "cusName",
    tooltip: true,
  },
  {
    label: "客户简称",
    prop: "cusShortName",
    tooltip: true,
  },
  {
    label: "客户分类",
    prop: "cusClassifyName",
    tooltip: true,
  },
  {
    label: "分管部门",
    prop: "orgainName",
    tag: "elDialog",
  },
  {
    label: "法人",
    prop: "legalPerson",
    tooltip: true,
  },
  {
    label: "税号",
    prop: "taxNumber",
    tooltip: true,
  },
  {
    label: "电话",
    prop: "telphone",
    tooltip: true,
  },
  {
    label: "地址",
    prop: "address",
    tooltip: true,
  },
  {
    label: "创建日期",
    prop: "createDate",
    tooltip: true,
  },
  {
    label: "最后一次修改时间",
    prop: "updateDate",
    tooltip: true,
    width: 140,
  },
];
// 新增 编辑表单数据
const plusDialogList = [
  {
    elCol: [
      {
        label: "客户编码",
        prop: "cusCode",
        tag: "elInput",
      },
      {
        label: "客户名称",
        prop: "cusName",
        tag: "elInput",
      },
      {
        label: "客户简称",
        prop: "cusShortName",
        tag: "elInput",
      },
    ],
  },
  {
    elCol: [
      {
        label: "客户分类",
        prop: "cusClassifyName",
        tag: "elInput",
        disabled: true,
      },
      {
        label: "分管部门",
        prop: "orgainName",
        tag: "elDialog",
      },
      {
        label: "法人",
        prop: "legalPerson",
        tag: "elInput",
      },
    ],
  },
  {
    elCol: [
      {
        label: "税号",
        prop: "taxNumber",
        tag: "elInput",
      },
      {
        label: "电话",
        prop: "telphone",
        tag: "elInput",
      },
      {
        label: "地址",
        prop: "address",
        tag: "elInput",
      },
    ],
  },
  {
    elCol: [
      {
        label: "省",
        prop: "province",
        tag: "elSelect",
        options: [],
      },
      {
        label: "市",
        prop: "city",
        tag: "elSelect",
        options: [],
      },
      {
        label: "县",
        prop: "county",
        tag: "elSelect",
        options: [],
      },
    ],
  },
];
// 新增表头数据
const plusTableColumn = [
  {
    label: "序号",
    prop: "index",
    tooltip: true,
    width: "80",
  },
  {
    label: "姓名",
    prop: "linkMan",
    tooltip: true,
  },
  {
    label: "手机号",
    prop: "mobile",
    tooltip: true,
  },
  {
    label: "电话",
    prop: "telphone",
    tooltip: true,
  },
  {
    label: "邮箱",
    prop: "Email",
    tooltip: true,
  },
  {
    label: "职务",
    prop: "duty",
    tooltip: true,
  },
  {
    label: "是否默认联系人",
    prop: "isdefault",
    tooltip: true,
    type:""
  },
  {
    label: "行号",
    prop: "rowIndex",
    tooltip: true,
  },
];
// 组织机构树表单
const treeFormData = [
  {
    elCol: [
      {
        label: "分类编码",
        prop: "code",
        tag: "elInput",
        span: 12,
      },
      {
        label: "分类名称",
        prop: "name",
        tag: "elInput",
        span: 12,
      },
    ],
  },
  {
    elCol: [
      {
        label: "顺序",
        prop: "sort",
        tag: "elInput",
        span: 12,
        rulesName: "integer",
        type: "number",
      },
      {
        label: "上级分类",
        prop: "codename",
        tag: "elInput",
        disabled: true,
        span: 12,
      },
    ],
  },
  {
    elCol: [
      {
        label: "备注",
        prop: "remark",
        tag: "elInput",
        span: 24,
      },
    ],
  },
];
// 查看
const showFormColumn = [
  {
    elCol: [
      {
        label: "客户编码",
        prop: "cusCode",
      },
      {
        label: "客户名称",
        prop: "cusName",
      },
      {
        label: "客户简称",
        prop: "cusShortName",
      },
    ],
  },
  {
    elCol: [
      {
        label: "客户分类",
        prop: "cusClassifyName",
      },
      {
        label: "分管部门",
        prop: "orgainName",
      },
      {
        label: "法人",
        prop: "legalPerson",
      },
    ],
  },
  {
    elCol: [
      {
        label: "税号",
        prop: "taxNumber",
      },
      {
        label: "电话",
        prop: "telphone",
      },
      {
        label: "地址",
        prop: "address",
      },
    ],
  },
  {
    elCol: [
      {
        label: "省",
        prop: "province",
      },
      {
        label: "市",
        prop: "city",
      },
      {
        label: "县",
        prop: "county",
      },
    ],
  },
];
const enclosureTableColumn = [
  {
    label: "序号",
    prop: "index",
    tooltip: true,
    width: "80",
  },
  {
    label: "文件名",
    prop: "sa_ShowName",
    tooltip: true,
  },
  {
    label: "上传人",
    prop: "personName",
    tooltip: true,
    width: "160",
  },
  {
    label: "上传时间",
    prop: "sa_UploadDateTime",
    tooltip: true,
    width: "160",
  },
  {
    label: "文件大小(kb)",
    prop: "sa_AttachmentSize",
    tooltip: true,
    width: "160",
  },
];

const rules = {
  cusName: [
    {
      required: true,
      message: "请输入客户名称",
      trigger: "blur",
    },
  ],
  cusCode: [
    {
      required: true,
      message: "请输入客户编码",
      trigger: "blur",
    },
  ],
  orgainName: [
    {
      required: true,
      message: "请选择分管部门",
      trigger: "blur",
    },
  ],
};
const rulesTreeDialog = {
  code: [
    {
      required: true,
      message: "请输入分类编码",
      trigger: "blur",
    },
  ],
  name: [
    {
      required: true,
      message: "请输入分类名称",
      trigger: "blur",
    },
  ],
  sort: [
    {
      required: true,
      message: "请输入数字",
      trigger: "blur",
    },
    // { type: "number", message: "请输入有效的数字", trigger: "blur" },
  ],
};
const plusTableColumnRules = {
  telphone: [
    {
      required: true,
      message: "请输入手机号吗",
      trigger: "blur",
    },
    { type: "phone", message: "请输入有效的手机号码", trigger: "blur" },
  ],
  Email: [
    {
      required: true,
      message: "请输入邮箱",
      trigger: "blur",
    },
    { type: "email", message: "请输入正确的邮箱", trigger: "blur" },
  ],
  rowIndex: [
    {
      required: true,
      message: "请输入行号",
      trigger: "blur",
    },
  ],
};

export default {
  userTableColumn, //用户档案表头
  plusDialogList, //新增表单数据
  plusTableColumn, //新增表格表头
  treeFormData,

  showFormColumn, //查看
  enclosureTableColumn,

  rules,
  rulesTreeDialog,
  plusTableColumnRules,
};
